Sudoplz/ios display hidden mounting#56649
Closed
SudoPlz wants to merge 335 commits intofacebook:mainfrom
Closed
Conversation
#publish-packages-to-npm&0.81-stable
…chronously (#14) * expose `flush` on RCTWebSocketModule to close all open websockets synchronously add log statement back * simplify code * simplify even more * change comment
For some reason the in-repo version isn't where this script it expects it to be (it's at `src` in our repo, whereas the script is looking in `lib`). This is likely due to us pulling down the source code directly whereas the script expects it to have gone through some build process first. In any case, this updates thes cript to prefer the version provided via NPM which does tend to work.
…cker. Add ability to override mSource of the image source.
This fixes an issues where the fabric renderer would get the correct sizing via onSizeChanged, write it to the shadow tree generating a state update callback and then setting the wrong size using ModalHostManager. Once onSizeChanged is fired by the OS it is treated as the definitive source of truth for sizing.
These podspecs all depend on a function defined in another Ruby file (which is kind of scary, but prooobably okay). However, they do not `require` that file, and instead (previously) were just relying on the fact that CocoaPods loads all the podspecs declared in your Podfile. This is fine for `pod install`, but doesn't apply to commands like `pod ipc spec` (which is used to convert an individual Podspec file to JSON). With that command, the PodSpecs were not evaluating successfully, as they didn't have access to this function. So we add the proper requires here and call it a day.
[fix] set background correctly in setFeedbackUnderlay
onHostPause already checks activeActivities and skips pausing when other activities are still active. onHostDestroy lacked this check, so destroying a secondary activity while the primary was still alive would move the shared ReactContext to BEFORE_CREATE. If the primary was never paused, no subsequent onHostResume would fire, leaving the context permanently destroyed and unresponsive to input. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Adding logs to Scheduler.cpp
…os-part feat: implement ios part of measureOnUI
## Summary: Mirrors useTraitHiddenOnAndroid from facebook#54112. Lets iOS apps opt out of the `Trait::Hidden` slice-skip; Android can already opt in. Default is `true`, preserving today's iOS behavior. What the optimization does D22134220 (2020, "Fabric: display: none nodes do not create views anymore") added `Trait::Hidden` and a slice-skip in `sliceChildShadowNodeViewPairs` that filters out subtrees whose Yoga display is None. On iOS the diff then issues REMOVE + DELETE for the entire subtree — invisible content stops costing anything. For most UIs this is a clean win. Where it bites The optimization assumes that `display: none` transitions are rare. That breaks for a specific pattern: **a custom host component mounted under `<Suspense>`**. Each suspend → resume cycle, Suspense flips display between `flex` and `none`. With the optimization on, every cycle: - tears down the entire subtree of UIViews, - drops per-instance native state — measurement caches, scroll position, animation drivers, anything internal to the host component, - re-runs `init`/`dealloc` and rebuilds the subtree on resume. Suspend/resume ends up heavier than a fresh mount, and any state the component held disappears between renders. What the flag does **It re-activates an existing code path. Nothing in the mounting layer is new.** The hide-via-`UIView.hidden` wiring shipped in D8460108 (June 2018, "Fabric: Default support of displayType and layoutDirection layout...") and has lived in `UIView+ComponentViewProtocol updateLayoutMetrics:` ever since — a few lines below the slice consumer in the same file. For two years it was the only iOS path; the 2020 slice-skip didn't replace it, it just made it unreachable in the common case. Setting the flag to `false` lets Hidden shadow nodes pass through the slice. The differ emits an `UPDATE_LAYOUT_METRICS` mutation with `displayType == None`, and the 2018 wiring picks it up: `self.hidden = YES` on the underlying UIView. Same view, hidden in place. Defaults - `useTraitHiddenOnIOS = true` — keeps the iOS behavior introduced in 2020. - `useTraitHiddenOnAndroid = false` — keeps the Android behavior, which never adopted the slice-skip. Both flags share the same semantic ("use the optimization"); the defaults encode each platform's pre-flag behavior. Flipping either default is out of scope. ## Changelog: [IOS] [ADDED] - useTraitHiddenOnIOS feature flag to opt out of the `display: none` slice-skip optimization ## Test Plan: No new tests. `StackingContextTest` exercises the slice-skip path and passes unchanged with the flag at its default `true`. Manually flipping the flag to `false` produces the existing Android branch's expected view tree (8 views, Hidden subtrees preserved with `self.hidden = YES`).
|
Warning Missing Test Plan Please add a "## Test Plan" section to your PR description. A Test Plan lets us know how these changes were tested. |
|
Warning JavaScript API change detected This PR commits an update to
This change was flagged as: |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Adds
useTraitHiddenOnIOSfeature flag - the iOS twin of Meta'suseTraitHiddenOnAndroid(#54112). Defaults totrueso iOS behavioris unchanged for anyone who doesn't override it.
RN's been carrying the wiring to hide views instead of destroying
them since 2018. A 2020 optimization started filtering hidden subtrees out of the mounting slice before they could reach that path.
This flag re-opens it on demand.
Next
falsein ourRCTAppDelegateand ships the fix.What's in this PR
sliceChildShadowNodeViewPairs.cpp(the only important code change).ReactNativeFeatureFlags.config.js,defaultValue: trueplus ~20 auto-generated files needed for the flag